package com.heima.listener;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class TestListener {
    /*
    * 消费者1号
    * @param message 收到的消息
    * */
    @KafkaListener(topics = "abc-topic",groupId = "group101")
    public void listener(String message){
        System.out.println(message);
    }

    /*
     * 消费者2号
     * @param message 收到的消息
     * */
    @KafkaListener(topics = "abc-topic",groupId = "group102")
    public void listener2(String message){
        System.out.println(message);
    }
}
